<?php

use think\facade\Route;

// api接口无需token模块
Route::group('partner', function () {
    // 通用模块
    Route::group('index', function () {
        Route::any('index', 'partner.Index/index')->name('首页');
        Route::any('getAgreement', 'partner.Index/getAgreement')->name('首页');
        Route::any('getServiceTel', 'partner.Index/getServiceTel')->name('获取财务电话');
        Route::any('getAppId', 'partner.Index/getAppId')->name('公众号ID');
    });
    Route::group('user', function () {
        Route::any('login', 'partner.User/login')->name('登录');
    });
    Route::group('sms', function () {
        Route::any('sendSms', 'partner.Sms/sendSms')->name('发送短信');
    });
})->allowCrossDomain();

// api接口模块
Route::group('partner', function () {
    Route::group('index', function () {
        Route::any('getNewNotice', 'partner.Index/getNewNotice')->name('公告');
        Route::any('getNewNoticeDetail', 'partner.Index/getNewNoticeDetail')->name('公告详情');
    });
    Route::group('order', function () {
        Route::any('getOrderList', 'partner.Order/getOrderList')->name('订单列表');
        Route::any('acceptOrder', 'partner.Order/acceptOrder')->name('接单');
        Route::any('refuseOrder', 'partner.Order/refuseOrder')->name('拒接');
        Route::any('evalOrder', 'partner.Order/evalOrder')->name('评价完成');
        Route::any('getCartReportList', 'partner.Order/getCartReportList')->name('验车报告题目');
        Route::any('setCartCheckReport', 'partner.Order/setCartCheckReport')->name('提交验车报告');
        Route::any('toPublic', 'partner.Order/toPublic')->name('放入大厅');
        Route::any('getReasonList', 'partner.Order/getReasonList')->name('取消原因列表');
    });
    Route::group('duty', function () {
        Route::any('getDutyList', 'partner.Duty/getDutyList')->name('值班列表');
        Route::any('setBusyTime', 'partner.Duty/setBusyTime')->name('设置忙碌时间');
        Route::any('cancel', 'partner.Duty/cancel')->name('取消设置');
        Route::any('getDayList', 'partner.Duty/getDayList')->name('某日列表');
    });
    Route::group('file', function () {
        Route::any('upload', 'partner.File/upload')->name('文件上传');
    });
    Route::group('user', function () {
        Route::any('getUserInfo', 'partner.User/getUserInfo')->name('用户信息');
        Route::any('getConversionRatio', 'partner.User/getConversionRatio')->name('转化率');
        Route::any('feedback', 'partner.User/feedback')->name('意见反馈');
        Route::any('setUserInfo', 'partner.User/setUserInfo')->name('设置个人信息');
        Route::any('writeOff', 'partner.User/writeOff')->name('账号注销');
        Route::any('studyList', 'partner.User/studyList')->name('学习列表');
        Route::any('studyInfo', 'partner.User/studyInfo')->name('学习详情');
        Route::any('getMoneyRecord', 'partner.User/getMoneyRecord')->name('钱包明细');
        Route::any('wxScope', 'partner.User/wxScope')->name('授权登录');
        Route::any('withdraw', 'partner.User/withdraw')->name('提现');
        Route::any('getUserQrcode', 'partner.User/getUserQrcode')->name('分享二维码');
    });
})->allowCrossDomain()->middleware('partner_auth');
